package cn.iocoder.yudao.module.bpm.message.local;

import cn.iocoder.yudao.module.bpm.message.ProcessInstanceMessage;
import cn.iocoder.yudao.module.bpm.message.dto.*;
import cn.iocoder.yudao.module.bpm.message.handle.ProcessInstanceMessageHandle;
import cn.iocoder.yudao.module.bpm.message.handle.ProcessTaskMessageHandle;
import lombok.extern.log4j.Log4j2;

@Log4j2
public class LocalProcessInstanceMessage implements ProcessInstanceMessage {

    private final ProcessInstanceMessageHandle processInstanceMessageHandle;

    private final ProcessTaskMessageHandle processTaskMessageHandle;

    public LocalProcessInstanceMessage(
            ProcessInstanceMessageHandle processInstanceMessageHandle,
            ProcessTaskMessageHandle processTaskMessageHandle

    ) {
        this.processInstanceMessageHandle = processInstanceMessageHandle;
        this.processTaskMessageHandle = processTaskMessageHandle;
    }
    @Override
    public void onProcessInstanceCleanMsg(BpmProcessInstanceCancelledMessage bpmProcessInstanceCancelledMessage) {

        processInstanceMessageHandle.onProcessInstanceCleanMsg(bpmProcessInstanceCancelledMessage);
    }

    @Override
    public void onProcessInstanceFinishedMsg(BpmProcessInstanceApproveMessage bpmProcessInstanceApproveMessage) {
        processInstanceMessageHandle.onProcessInstanceFinishedMsg(bpmProcessInstanceApproveMessage);
    }

    @Override
    public void onProcessInstanceRejectMsg(BpmProcessInstanceRejectMessage bpmProcessInstanceRejectMessage) {
        processInstanceMessageHandle.onProcessInstanceRejectMsg(bpmProcessInstanceRejectMessage);
    }

    @Override
    public void onProcessInstanceCreatedMsg(BpmProcessInstanceCreatedMessage bpmProcessInstanceCreatedMessage) {
        processInstanceMessageHandle.onProcessInstanceCreatedMsg(bpmProcessInstanceCreatedMessage);
    }

    @Override
    public void onProcessInstanceStartedMsg(BpmProcessInstanceStartedMessage bpmProcessInstanceStartedMessage) {
        processInstanceMessageHandle.onProcessInstanceStartedMsg(bpmProcessInstanceStartedMessage);
    }
}
